﻿using System;
using System.Collections.Generic;
using Module.Common.Models;
using Module.Core.DAO;
using Module.Core.EntitiesInfo;


namespace Module.Core.BusinessLogic
{
    public class FAQQuestions
	{
		/// <summary>
		/// Saves a record to the FAQ_Questions table.
		/// </summary>
		public static int Insert(FAQQuestionsInfo fAQQuestionsInfo)
		{
			try
			{
				return new FAQQuestionsDAO().Insert(fAQQuestionsInfo);
			}
			catch (Exception ex)
			{
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the FAQ_Questions table.
		/// </summary>
        public static void Update(FAQQuestionsInfo fAQQuestionsInfo)
		{
			try
			{
				new FAQQuestionsDAO().Update(fAQQuestionsInfo);
			}
			catch (Exception ex)
			{
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the FAQ_Questions table.
		/// </summary>
        public static void Delete(int fAQ_ID)
		{
			try
			{
				new FAQQuestionsDAO().Delete(fAQ_ID);
			}
			catch (Exception ex)
			{
				throw;
			}
      
		}
      
		/// <summary>
		/// Selects a single record from the FAQ_Questions table.
		/// </summary>
        public static FAQQuestionsInfo Select(int fAQ_ID)
		{
			try
			{
				return new FAQQuestionsDAO().Select(fAQ_ID);
			}
			catch (Exception ex)
			{
				throw;
			}
           
		}

		/// <summary>
		/// Selects all records from the FAQ_Questions table.
		/// </summary>
        public static CHRTList<FAQQuestionsInfo> SelectAll(int fAQID)
        {
            try
            {
                return new FAQQuestionsDAO().SelectAll();
            }
            catch (Exception ex)
            {
                throw;
            }

        }


        /// <summary>
        /// Search all records from the FAQ_Questions table.
        /// </summary>
        public static CHRTList<FAQQuestionsInfo> SearchAll(string question, int status, int from, int to)
        {
            try
            {
                return new FAQQuestionsDAO().SearchAll(question, status, from, to);
            }
            catch (Exception ex)
            {
                throw;
            }

        }


        public static int GetCount(string question, int status)
        {
            try
            {
                return new FAQQuestionsDAO().GetCount(question, status);
            }
            catch (Exception)
            {

                throw;
            }
        }
	}
}
